﻿@model RuTracker.MVC.Models.Login.LoginModel
@using RuTracker.MVC.Core.HtmlHelpers;

@{
    ViewBag.Title = "Index";
}


<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Login page</title>
    <link href="@Url.Content("~/Styles/style.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Styles/validation.css")" rel="stylesheet" type="text/css" />
</head>
    <body>
        @using (Html.BeginForm("Index", "Authorize", FormMethod.Post, new { id="form" }))
        {
           <div align="center">
                <div>
                    <h2>
                        Enter credentials for <a href="http://rutracker.org/forum/index.php">RuTracker</a> website
                    </h2>
                </div>
                <div>
                    <table>
                        <tr>
                            <td>
                                @Html.LabelFor(x => x.UserName)
                            </td>
                            <td>
                                @Html.TextBoxFor(x => x.UserName)
                            </td>
                            <td>
                                @Html.ValidationMessageFor(x => x.UserName)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.LabelFor(x => x.Password)
                            </td>
                            <td>
                                @Html.PasswordFor(x => x.Password)
                            </td>
                            <td>
                                @Html.ValidationMessageFor(x => x.Password)
                            </td>
                        </tr>
                        @if (Model.IsCaptchaRequired)
                        {
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <div>
                                        @Html.Image("GetCapture", "Authorize")
                                    </div>
                                </td>
                                <td />
                            </tr>
                            <tr>
                                <td></td>
                                <td>
                                    @Html.TextBoxFor(x => x.CaptchaCodeValue)
                                </td>
                                <td>
                                    @Html.ValidationMessageFor(x => x.CaptchaCodeValue)
                                </td>
                            </tr>
                        }
                        <tr>
                            <td />
                            <td colspan="2">
                                <div align="right">
                                    <input id="submitButton" type="submit" value="Login" />
                                </div>
                            </td>
                            <td/>
                        </tr>
                    </table>
                </div>        
            </div>
        }
    </body>
</html>

